home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\SCRIPT\UHNOTIFY < prev    next >
Text File  |  1994-12-28  |  2KB  |  68 lines

  1. # new userhost notify script.  matthew green (mrg@mame.mu.oz.au)
  2. # $Id: uhnotify,v 1.5 1994/07/25 15:08:31 mrg Stab $
  3. # this is public domain.
  4.  
  5. # first, we check to see how smart we can be.  newer ircii's can
  6. # handle multiple nicks with userhost -cmd's.
  7.  
  8. if (V < 19931229)
  9. {
  10.     on ^notify_signon * userhost $$0 -cmd userhost_notify $$$$*
  11. }
  12. {
  13.     on ^notify_signon * userhost_notify_cache $$0
  14. }
  15.  
  16. @userhost_notify_count = 0
  17.  
  18. # how to display the notify signon
  19. alias userhost_notify if ([$3] != [<UNKNOWN>]) { xecho -level crap *** Signon by $0 \($3@$4\) detected }
  20.  
  21.  
  22. # what this does, is first check if userhost() has anything useful,
  23. # and if so, use that, and display it.  the it checks to see if
  24. # the userhost look up cache is full (5 elements), and if so it
  25. # runs the cache.  else it adds the nick to the cache, and puts
  26. # a time to run the cache (default 10 seconds).
  27.  
  28. alias userhost_notify_cache
  29. {
  30.     if ([] == userhost())
  31.     {
  32.         @userhost_notify_count = userhost_notify_count + 1
  33.         if (userhost_notify_list == [])
  34.         {
  35.             timer 10 uncache_notify
  36.             @userhost_notify_list = [$0]
  37.         }
  38.         {
  39.             @userhost_notify_list = userhost_notify_list ## [ $0]
  40.             if (5 == userhost_notify_count)
  41.             {
  42.                 uncache_notify
  43.             }
  44.         }
  45.     }
  46.     {
  47.         @uhn.userhost = userhost()
  48.         @uhn.user = left($index(@ $uhn.userhost) $uhn.userhost)
  49.         @uhn.host = mid(${index(@ $uhn.userhost) + 1} 999 $uhn.userhost)
  50.         userhost_notify $0 dummy dummy $uhn.user $uhn.host
  51.         assign -uhn.userhost
  52.         assign -uhn.user
  53.         assign -uhn.host
  54.     }
  55. }
  56.  
  57. # if the cache isn't null, it sends the userhost -cmd away with the
  58. # full cache, and resets the right bits.
  59. alias uncache_notify
  60. {
  61.     if ([] != userhost_notify_list)
  62.     {
  63.         userhost $userhost_notify_list -cmd userhost_notify $$*
  64.         ^assign -userhost_notify_list
  65.         @userhost_notify_count = 0
  66.     }
  67. }
  68.